package com.huluobo.a2207parkdemo.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.huluobo.a2207parkdemo.R
import com.huluobo.base.bean.NewsBeanItem

/**
 *  Created by LC on 2024/11/23.
 */
class NewsAdapter : BaseQuickAdapter<NewsBeanItem, BaseViewHolder>(R.layout.item_news) {
    override fun convert(helper: BaseViewHolder, item: NewsBeanItem) {
        helper.setText(R.id.item_news_title_tv, item.newsTitle)
        helper.setText(R.id.item_news_value_tv, item.newsValue)
        helper.setText(R.id.item_news_time_tv, item.newsTime)
        when (item.tagId) {
            0 -> helper.setText(R.id.item_news_tag_tv, "物业新闻")
            1 -> helper.setText(R.id.item_news_tag_tv, "娱乐新闻")
            2 -> helper.setText(R.id.item_news_tag_tv, "体育新闻")
            3 -> helper.setText(R.id.item_news_tag_tv, "社会新闻")
            4 -> helper.setText(R.id.item_news_tag_tv, "早间新闻")
        }
    }
}